package com.chamber.web.controller.common.User;

import com.chamber.business.domain.dto.UserLoginDTO;
import com.chamber.business.domain.vo.UserLoginVO;
import com.chamber.business.service.UserService;
import com.chamber.common.core.domain.AjaxResult;
import io.swagger.annotations.Api;
import io.swagger.annotations.ApiOperation;
import lombok.extern.slf4j.Slf4j;
import org.springframework.web.bind.annotation.RequestBody;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RestController;

import javax.annotation.Resource;

@Slf4j
@Api(tags = "用户相关接口")
@RestController
@RequestMapping("/user")
public class UserController {
    @Resource
    UserService userService;

    @ApiOperation("用户账号密码登录")
    @RequestMapping("/login")
    public AjaxResult<UserLoginVO> Login(@RequestBody UserLoginDTO userLoginDTO) {
        return AjaxResult.success(userService.login(userLoginDTO));
    }


}
